<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>线性渐变</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
    </style>
</head>

<body>
    <svg xmlns="http://www/w3.org/2000/svg" version="1.1">
        <!-- 
            渐变: 就是一种从一种颜色到另一种颜色的平滑过渡,也可以把多个颜色过渡应用到同一个元素上
            linear 线性渐变
            radial 径向渐变/ 放射性渐变
            <linearGradient>标签 x1 y1 x2 y2 分别定义的是渐变开始和结束的位置
         -->
        <defs>
            <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
                <stop offset="0%" style="stop-color: rgb(255, 255, 0); stop-opacity: 1" />
                <stop offset="50%" style="stop-color: rgb(255, 0, 255); stop-opacity: 1" />
                <stop offset="100%" style="stop-color: rgb(255, 0, 0); stop-opacity: 1" />
            </linearGradient>
        </defs>
        <ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)" />
    </svg>

</body>

</html>